package com.fafu.rbac.conterter;

import com.fafu.common.web.converter.BaseConverter;
import com.fafu.rbac.domain.entity.Permission;
import com.fafu.rbac.domain.vo.PermissionVO;

public class PermissionConverter extends BaseConverter<Permission, PermissionVO> {
    @Override
    protected PermissionVO entity2VO(Permission permission) {
        if (permission == null) {
            return null;
        }
        PermissionVO permissionVO = new PermissionVO();
        permissionVO.setId(permission.getId());
        permissionVO.setName(permission.getName());
        permissionVO.setCode(permission.getCode());
        permissionVO.setPath(permission.getPath());
        permissionVO.setIcon(permission.getIcon());
        permissionVO.setState(permission.getState());
        return permissionVO;
    }
}
